An IC card is a plastic card containing an embedded LSI chip with on-chip CPU and memory. Since an IC card can ensure higher security and store a greater volume of data than a conventional magnetic card, a single card can be used to implement a plurality of functions such as credit card or electronic money functions. A variety of IC card standards are well known such as MULTOS, JAVACARD, and Smart Card for Windows. Various types of IC card terminals have been provided for accessing and communicating with these kinds of IC cards.
FIG. 4 is a diagram showing a first example of the configuration of communication between an IC card and IC card terminal by using the conventional method. FIG. 4 shows the program structures of the IC card and IC card terminal, respectively, and the inter-program communication configuration. IC card 1 is equipped with card-side application programs (hereafter, referred to as card applications) PA, PB, and PC, which correspond to a plurality of functions A, B, and C, respectively, and the card I/O. The card I/O (input/output) is a part of the IC card OS (operating system).
FIG. 4 is a communication configuration example in which IC card terminal 10 has only a terminal-side application program (hereafter, referred to as a terminal application) RA, which corresponds to function A. Terminal application RA communicates with card application PA via provider QA of terminal application RA and an IFD (interface device) driver for controlling communication with the IC card, as well as via the card I/O. Commands from terminal application RA are directed to the corresponding card application PA by the card I/O. In other words, in FIG. 4, terminal applications and card applications have one-to-one relationships, and the IFD driver receives commands only from one terminal application.
FIG. 5 is a diagram showing a second example of the configuration of communication between an IC card and IC card terminal by using the conventional method. Specifically, FIG. 5 is a communication configuration example in which IC card terminal 10 has one terminal application RABC, which corresponds to functions A, B, and C. In this case, although terminal application RABC corresponds to a plurality of functions, it does not simultaneously access a plurality of card applications in parallel. For example, while terminal application RABC is communicating with card application PA, it does not communicate with other card applications PB and PC. In other words, in FIG. 5, terminal applications and card applications have one-to-many relationships, but even in this case, the IFD driver receives commands only from one terminal application.
However, when terminal applications and card applications have one-to-many relationships as described above, to add card applications corresponding to new functions to an IC card or to change some functions, all of the terminal applications of an IC card terminal must be newly created and exchanged, which is extremely troublesome.
FIG. 6 is a diagram showing a third example of the configuration of communication between an IC card and IC card terminal by using the conventional method. Specifically, FIG. 6 is a communication configuration example in which IC card terminal 10 has a plurality of terminal applications RA, RB, and RC, which correspond to functions A, B, and C, respectively. In other words, in FIG. 6, terminal applications and card applications have many-to-many relationships. With these kinds of relationships, to add or change card applications, only the terminal applications corresponding to those card applications need to be added or changed in the IC card terminal, so the IC card terminal can support the addition or change of IC card functions with flexibility.
However, many-to-many relationships may result in the following kinds of problems. Since each of the terminal applications are mutually independent, each terminal application sends commands to the IFD driver regardless of whether or not another terminal application is communicating. If the IFD driver receives a new command while communication is in progress, it disconnects the communication path where communication is in progress, and establishes a communication path corresponding to the new command.
For example, terminal application RB sends a command intended for card application PB to the IFD driver while terminal application RA is communicating with card application PA. When this is done, the IFD driver disconnects the communication path to card application PA and establishes a communication path to card application PB. In other words, the card I/O of the IC card directs the command from the IFD driver to card application PB. Therefore, the command from terminal application RA ends up being sent to card application PB, and an application error occurs. Also, the response from card application PA is not sent to terminal application RA, and a communication error occurs.